home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual C++ Utilities / i Mag 2.0 / caImagX.CAB / frmSave.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2003-04-05  |  5.3 KB  |  178 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmSave 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "SAVE AS ..."
  6.    ClientHeight    =   5445
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   4905
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5445
  15.    ScaleWidth      =   4905
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.OptionButton opSave 
  18.       Caption         =   "TIFF File"
  19.       Height          =   315
  20.       Index           =   3
  21.       Left            =   3360
  22.       TabIndex        =   8
  23.       Top             =   210
  24.       Width           =   1000
  25.    End
  26.    Begin VB.CommandButton cmOK 
  27.       Caption         =   "OK"
  28.       Height          =   375
  29.       Left            =   3360
  30.       TabIndex        =   7
  31.       Top             =   4740
  32.       Width           =   1425
  33.    End
  34.    Begin VB.PictureBox pi00 
  35.       BackColor       =   &H80000010&
  36.       Height          =   3855
  37.       Left            =   150
  38.       ScaleHeight     =   3795
  39.       ScaleWidth      =   4575
  40.       TabIndex        =   4
  41.       Top             =   690
  42.       Width           =   4635
  43.       Begin VB.PictureBox pi0 
  44.          Appearance      =   0  'Flat
  45.          AutoSize        =   -1  'True
  46.          BackColor       =   &H80000010&
  47.          BorderStyle     =   0  'None
  48.          ForeColor       =   &H80000008&
  49.          Height          =   3855
  50.          Left            =   0
  51.          ScaleHeight     =   3855
  52.          ScaleWidth      =   4635
  53.          TabIndex        =   5
  54.          Top             =   0
  55.          Width           =   4635
  56.       End
  57.    End
  58.    Begin MSComctlLib.Slider sldJPG 
  59.       Height          =   465
  60.       Left            =   1560
  61.       TabIndex        =   3
  62.       Top             =   4680
  63.       Width           =   1485
  64.       _ExtentX        =   2619
  65.       _ExtentY        =   820
  66.       _Version        =   393216
  67.       Enabled         =   0   'False
  68.       Min             =   1
  69.       Max             =   100
  70.       SelStart        =   65
  71.       TickStyle       =   1
  72.       TickFrequency   =   10
  73.       Value           =   65
  74.    End
  75.    Begin VB.OptionButton opSave 
  76.       Caption         =   "JPG File"
  77.       Height          =   315
  78.       Index           =   2
  79.       Left            =   2310
  80.       TabIndex        =   2
  81.       Top             =   210
  82.       Width           =   1000
  83.    End
  84.    Begin VB.OptionButton opSave 
  85.       Caption         =   "GIF File"
  86.       Height          =   315
  87.       Index           =   1
  88.       Left            =   1260
  89.       TabIndex        =   1
  90.       Top             =   210
  91.       Width           =   1000
  92.    End
  93.    Begin VB.OptionButton opSave 
  94.       Caption         =   "BMP File"
  95.       Height          =   315
  96.       Index           =   0
  97.       Left            =   210
  98.       TabIndex        =   0
  99.       Top             =   210
  100.       Width           =   1000
  101.    End
  102.    Begin VB.Label lbJpg 
  103.       Caption         =   "JPG Compression"
  104.       Enabled         =   0   'False
  105.       Height          =   285
  106.       Left            =   150
  107.       TabIndex        =   6
  108.       Top             =   4830
  109.       Width           =   1515
  110.    End
  111. Attribute VB_Name = "frmSave"
  112. Attribute VB_GlobalNameSpace = False
  113. Attribute VB_Creatable = False
  114. Attribute VB_PredeclaredId = True
  115. Attribute VB_Exposed = False
  116. Option Explicit
  117. Private m_Cancel As Boolean
  118. Private m_Compression As Integer
  119. Private m_Extension As String
  120. Private Sub cmOK_Click()
  121. On Error GoTo SErr
  122. SErr: If ErrS Then Exit Sub
  123.     m_Cancel = False
  124.     Unload Me
  125. End Sub
  126. Private Sub Form_Load()
  127. On Error GoTo SErr
  128. SErr: If ErrS Then Exit Sub
  129.     m_Cancel = True
  130.     m_Compression = 65
  131.     opSave(0) = True
  132.     pi0.Picture = frmTest.piX.Picture
  133.     pi0.Move (pi00.Width - pi0.Width) / 2, (pi00.Height - pi0.Height) / 2
  134.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  135. End Sub
  136. Public Property Get Cancel() As Boolean
  137.     Cancel = m_Cancel
  138. End Property
  139. Public Property Get Compression() As Integer
  140.     Compression = m_Compression
  141. End Property
  142. Public Property Get Extension() As String
  143.     Extension = m_Extension
  144. End Property
  145. Function ErrS() As Boolean
  146.     ErrS = False
  147.     If Err.Number <> 0 Then
  148.         MsgBox "Error with number: " & Format(Err.Number, "#,##0") & vbCr & vbCr & Err.Description, vbCritical, "ERROR"
  149.         ErrS = True
  150.         Err.Clear
  151.     End If
  152. End Function
  153. Private Sub opSave_Click(Index As Integer)
  154. On Error GoTo SErr
  155. SErr: If ErrS Then Exit Sub
  156.     If Index = 0 Then m_Extension = "bmp"
  157.     If Index = 1 Then m_Extension = "gif"
  158.     If Index = 2 Then m_Extension = "jpg"
  159.     If Index = 3 Then m_Extension = "tif"
  160.     If Index = 2 Then
  161.         lbJpg.Enabled = True
  162.         sldJPG.Enabled = True
  163.     Else
  164.         lbJpg.Enabled = False
  165.         sldJPG.Enabled = False
  166.     End If
  167. End Sub
  168. Private Sub sldJPG_Change()
  169. On Error GoTo SErr
  170. SErr: If ErrS Then Exit Sub
  171.     Dim tmp As String
  172.     tmp = App.Path & "\~tmp"
  173.     frmTest.piX.SavePicture tmp, caFileJpg, sldJPG.Value
  174.     pi0.Picture = LoadPicture(tmp)
  175.     m_Compression = sldJPG.Value
  176.     Kill tmp
  177. End Sub
  178.